.class Lcom/xingbook/ui/a/g;
.super Ljava/lang/Object;

# interfaces
.implements Landroid/hardware/Camera$PictureCallback;


# instance fields
.field final synthetic a:Lcom/xingbook/ui/a/f;


# direct methods
.method constructor <init>(Lcom/xingbook/ui/a/f;)V
    .locals 0

    iput-object p1, p0, Lcom/xingbook/ui/a/g;->a:Lcom/xingbook/ui/a/f;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onPictureTaken([BLandroid/hardware/Camera;)V
    .locals 4

    iget-object v0, p0, Lcom/xingbook/ui/a/g;->a:Lcom/xingbook/ui/a/f;

    invoke-static {v0}, Lcom/xingbook/ui/a/f;->a(Lcom/xingbook/ui/a/f;)Landroid/graphics/Bitmap;

    move-result-object v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ui/a/g;->a:Lcom/xingbook/ui/a/f;

    invoke-static {v0}, Lcom/xingbook/ui/a/f;->a(Lcom/xingbook/ui/a/f;)Landroid/graphics/Bitmap;

    move-result-object v0

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->recycle()V

    iget-object v0, p0, Lcom/xingbook/ui/a/g;->a:Lcom/xingbook/ui/a/f;

    const/4 v1, 0x0

    invoke-static {v0, v1}, Lcom/xingbook/ui/a/f;->a(Lcom/xingbook/ui/a/f;Landroid/graphics/Bitmap;)V

    :cond_0
    const/4 v0, 0x0

    array-length v1, p1

    invoke-static {p1, v0, v1}, Landroid/graphics/BitmapFactory;->decodeByteArray([BII)Landroid/graphics/Bitmap;

    move-result-object v0

    iget-object v1, p0, Lcom/xingbook/ui/a/g;->a:Lcom/xingbook/ui/a/f;

    invoke-static {v1, v0}, Lcom/xingbook/ui/a/f;->a(Lcom/xingbook/ui/a/f;Landroid/graphics/Bitmap;)V

    if-eqz v0, :cond_1

    :try_start_0
    new-instance v1, Ljava/io/FileOutputStream;

    iget-object v2, p0, Lcom/xingbook/ui/a/g;->a:Lcom/xingbook/ui/a/f;

    invoke-static {v2}, Lcom/xingbook/ui/a/f;->b(Lcom/xingbook/ui/a/f;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/io/FileOutputStream;-><init>(Ljava/lang/String;)V

    sget-object v2, Landroid/graphics/Bitmap$CompressFormat;->JPEG:Landroid/graphics/Bitmap$CompressFormat;

    const/16 v3, 0x64

    invoke-virtual {v0, v2, v3, v1}, Landroid/graphics/Bitmap;->compress(Landroid/graphics/Bitmap$CompressFormat;ILjava/io/OutputStream;)Z

    invoke-virtual {v1}, Ljava/io/FileOutputStream;->flush()V

    invoke-virtual {v1}, Ljava/io/FileOutputStream;->close()V

    iget-object v0, p0, Lcom/xingbook/ui/a/g;->a:Lcom/xingbook/ui/a/f;

    invoke-static {v0}, Lcom/xingbook/ui/a/f;->c(Lcom/xingbook/ui/a/f;)V

    iget-object v0, p0, Lcom/xingbook/ui/a/g;->a:Lcom/xingbook/ui/a/f;

    iget-object v0, v0, Lcom/xingbook/ui/a/f;->b:Lcom/xingbook/ui/b/a;

    new-instance v1, Ljava/lang/StringBuilder;

    iget-object v2, p0, Lcom/xingbook/ui/a/g;->a:Lcom/xingbook/ui/a/f;

    invoke-static {v2}, Lcom/xingbook/ui/a/f;->b(Lcom/xingbook/ui/a/f;)Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v2, ".jpg"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/xingbook/ui/b/a;->a(Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    :cond_1
    :goto_0
    return-void

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/io/IOException;->printStackTrace()V

    iget-object v0, p0, Lcom/xingbook/ui/a/g;->a:Lcom/xingbook/ui/a/f;

    invoke-static {v0}, Lcom/xingbook/ui/a/f;->c(Lcom/xingbook/ui/a/f;)V

    goto :goto_0
.end method
